var webpackConfig = require('../../build/webpack.test.conf')

module.exports = function (config) {
    config.set({
        browsers: ['Chrome'],

        customLaunchers: {
            ChromeHeadlessNoSandbox: {
                base: 'ChromeHeadless',
                flags: ['--no-sandbox']
            }
        },
        frameworks: ['mocha', 'sinon-chai', 'phantomjs-shim'],
        reporters: ['spec', 'coverage'],
        // import cdn to define every plugin you use, include lodash, semantic, jquery
        files: [
            'https://code.jquery.com/jquery-3.3.1.min.js',
            'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js',
            'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.11.8/semantic.min.css',
            'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.3/semantic.min.js',
            './index.js'
        ],
        preprocessors: {
            './index.js': ['webpack', 'sourcemap']
        },
        webpack: webpackConfig,
        webpackMiddleware: {
            noInfo: true
        },
        coverageReporter: {
            dir: './coverage',
            reporters: [
                {type: 'lcov', subdir: '.'},
                {type: 'text-summary'}
            ]
        }
    })
}